<template>
    <el-aside width="200px">
        <el-menu
            background-color="#94bee9"
            :default-active="$route.path"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            text-color="#fff"
            active-text-color="#ffd04b"
        >
            <router-link to="/">
                <el-menu-item index="/home">
                    <template slot="title">
                        <i class="el-icon-s-home"></i>
                        <span>首页</span>
                    </template>
                </el-menu-item>
            </router-link>

            <el-submenu index="1">
                <template slot="title">
                    <i class="el-icon-location"></i>
                    <span>商品</span>
                </template>
                <el-menu-item-group>
                    <router-link to="/pms/product">
                        <el-menu-item index="/pms/product">商品列表</el-menu-item>
                    </router-link>
                    <router-link to="/pms/productadd">
                        <el-menu-item index="/pms/productadd">添加商品</el-menu-item>
                    </router-link>
                    <router-link to="/pms/productCate">
                        <el-menu-item index="/pms/productCate">商品分类</el-menu-item>
                    </router-link>
                    <el-menu-item index="1-4">商品类型</el-menu-item>
                    <el-menu-item index="1-5">品牌管理</el-menu-item>
                </el-menu-item-group>
            </el-submenu>

            <el-submenu index="2">
                <template slot="title">
                    <i class="el-icon-s-order"></i>
                    <span>订单</span>
                </template>
            </el-submenu>
        </el-menu>
    </el-aside>
</template>

<script>
export default {
    methods: {
        handleOpen() {
            console.log("打开菜单");
        },
        handleClose() {
            console.log("关闭菜单");
        },
    },
};
</script>

<style lang="scss" scoped>
.el-aside {
    background-color: $primary-color;
    border: 1px solid #eee;
    overflow: hidden;
    .el-menu {
        border: none;
        i {
            color: white;
        }
    }
}
</style>
